<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">

    <title></title>
    <!-- 引入 jQuery Mobile 样式 -->
    <link rel="stylesheet" href="http://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.css">
    <!-- 引入 jQuery 库 -->
    <script src="http://apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>
    <!-- 引入 jQuery Mobile 库 -->
    <script src="http://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>


    <link href="https://cdn.bootcss.com/jquery-mobile/1.4.5/jquery.mobile.theme.css" rel="stylesheet">

    <script src="https://cdn.bootcss.com/jquery-validate/1.16.0/jquery.validate.js"></script>
    <script src="https://cdn.bootcss.com/jquery.form/4.2.1/jquery.form.js"></script>
    <script src="js/jquerymobile_popup.js"></script>
<!--    <script type="text/javascript">-->
<!--        function login(){-->
<!--            //	openPopup('信息提示','提示',undefined,true,undefined,'error','cn');-->
<!--            //	WeixinJSBridge.call('closeWindow');-->
<!--        }-->
<!--    </script>-->
    <style type="text/css">
        .ui-page{
            background:#eee;
        }
    </style>
</head>
<body>
<div data-role="page" id="pageMain" style="background-color: #4E90C7;">
    <div style="text-align:center;"><img src="images/dada_logo1.png" style="width: 100%;" th:src="@{/images/dada_logo1.png}"></div>

    <div data-role="content" class="content">
        <form id="login_params" method="post" >
            <div>
                <input type="text" id="email" name="email" placeholder="公司邮箱" style="background: url('${pageContext.request.contextPath}/images/ic_mail.png') no-repeat 5px;background-size: 30px;padding-left:40px;">
                <input type="hidden" th:value="${wid}" id="wid">
            </div>
            <div align="center" style="padding-top:30px;">
                <input id="pubBtn" type="button" value="登录"  onclick="login();" style="padding:10px;background: #E57330;text-shadow: none;opacity:100;color:white;font-size:20px;text-indent:0px;font-family:微软雅黑;border: none;-webkit-appearance:none;-moz-appearance:none;width: 100%;border-radius:7px;" >
            </div>
        </form>

    </div>
</div>


</body>
</html>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">

    <title></title>
    <!-- 引入 jQuery Mobile 样式 -->
    <link rel="stylesheet" href="http://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.css">
    <!-- 引入 jQuery 库 -->
    <script src="http://apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>
    <!-- 引入 jQuery Mobile 库 -->
    <script src="http://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>


    <link href="https://cdn.bootcss.com/jquery-mobile/1.4.5/jquery.mobile.theme.css" rel="stylesheet">

    <script src="https://cdn.bootcss.com/jquery-validate/1.16.0/jquery.validate.js"></script>
    <script src="https://cdn.bootcss.com/jquery.form/4.2.1/jquery.form.js"></script>
    <script src="js/jquerymobile_popup.js" th:src="@{/js/jquerymobile_popup.js}"></script>
    <script type="text/javascript">
        function login(){
            //	openPopup('信息提示','提示',undefined,true,undefined,'error','cn');
            //	WeixinJSBridge.call('closeWindow');
            var email=$("#email").val()
            var wid=$("#wid").val();
            if(email.length<1){
                alert("邮箱不能为空");
                return;
            }

            $.ajax({
                url:"[[@{/user/login}]]",
                data:{"email":email,"wid":wid},
                type:"POST",
                success: function(msg){
                      if(msg=="1"){
                          openPopup('邮箱不存在,联系管理员','提示',undefined,true,undefined,'error','cn');
                          // alert('邮箱不存在,联系管理员')

                      }else if(msg=='2'){
                          openPopup('该邮箱已被登录,请联系管理员','提示',undefined,true,undefined,'error','cn');
                          // alert('该邮箱已被登录,请联系管理员')

                      }else if (msge=="3"){
                          openPopup('绑定成功','提示',undefined,true,undefined,'error','cn');
                          window.close();
                          // alert('绑定成功')
                      }else {
                          openPopup('网络异常');
                          // alert('网络异常')
                      }
                }
            });

        }
    </script>
    <style type="text/css">
        .ui-page{
            background:#eee;
        }
    </style>


</html>
